using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyDeadBringerAttack :EnemyState
{
    private EnemyDeadBringer enemy;
    public EnemyDeadBringerAttack(Enemy _enemybase, EnemyStateMachine _stateMachine, string _animBoolName,EnemyDeadBringer _enemy) : base(_enemybase, _stateMachine, _animBoolName)
    {
        this.enemy= _enemy;
    }

    public override void Enter()
    {
        base.Enter();
        enemy.chanceToTeleport += 5;
    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void Update()
    {
        base.Update();
        enemy.SetZeroVelocity();
        if (triggerCalled)
        {
            if(enemy.CanTeleport())
            { 
            stateMachine.ChangeState(enemy.deadBringerteleport);
            }
            else
            {
                stateMachine.ChangeState(enemy.deadBringerBattle);
            }

        }

    }
}
